#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define pb push_back
#define mp make_pair
long long n;
long long a[100010];
long long r[100010];
set<long long> s;
long long t;
long long z;
signed main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    cin >> n;
    for (long long i = 1; i <= n; i++)
    {
        cin >> a[i];
        s.insert(a[i]);
        r[a[i]]++;
    }
    for (auto &i : s)
    {
        if (r[i] >= t)
        {
            z += t;
            t = 0;
        }
        else
        {
            z += r[i];
            t -= r[i];
        }
        t += r[i];
    }
    cout << n - z << "\n";
    return 0;
}